<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 选中有s1类名的子元素，不论在什么位置，只看test1下有s1类名的第一个 */
        .test1 .s1:first-of-type{
            background-color: #FFA500;
        }
    </style>
</head>
<body>
    <div class="test1">
        <a href="">000</a>
        <a href="" class="s1">111</a>

        <b class="s1">222</b>
        <b class="s1">333</b>

        <div>
            <a href="">444</a>

            <span class="s1">555</span>
            <span class="s1">666</span>
        </div>
    </div>
</body>
</html>